 function ShowQuestion() {

            //document.form1.time.disabled=false;
            //document.form1.title.disabled=false;
            var continu = document.getElementById('questionsSec');
            continu.style.visibility = 'visible';

        }
        function addAnswer() {
            var ans = document.forms["form1"]["Select1"].value;
            if (ans == "Mutiple Choice") {
                var i;
                for (i = 0; i <= 3; i++) {
                    //var answer = prompt ("your Answer plz","true"); 
                    //      document.getElementById("fooBar[]").innerHTML=answer;
                    add('checkbox');

                }
            }
            else if (ans == "TrueFalse") {
                var i;

                for (i = 0; i < 2; i++) {
                    var counter = 1;
                    // start name the elemnt
                    //var answer = prompt ("your Answer plz","true"); 
                    // document.getElementById("fooBar[]").innerHTML=answer;
                    add('radio');

                }
            }
            else {
                var answer = prompt("your Answer plz", "true");
                document.getElementById("fooBar").innerHTML = answer;
                add('textbox');
            }
        }

        function add(type) {
            //     addInput(dynamicInput,answer,type);
            var cntr = 0;
            //Create an input type dynamically.
            var element = document.createElement("input");
            //Assign different attributes to the element.
            element.setAttribute("type", type);
            element.setAttribute("value", type);
            element.setAttribute("name", type);
            var foo = document.getElementById("fooBar");
            //Append the element in page (in span).
            // foo.appendChild(element); 
            foo.appendChild(element);
            // Add a name to it
            //foo.innerHTML=answer
            //document.getAttribute(foo).innerHTML=answer;
        }
        //Add name
        var counter = 0;
        var limit = 4;
        //if ( document.forms["form1"]["Select1"].value == 'TrueFalse'){counter=2;}
        //else {counter=0;}
        function addInput(divName) {

            if (counter == limit) {
                alert("You have reached the limit of adding " + counter + " inputs");
            }
            else {
                var newdiv = document.createElement('div');
                newdiv.innerHTML = "Answer " + (counter + 1) + " <br><input type='text' name='myInputs[]'>";
                document.getElementById(divName).appendChild(newdiv);
                counter++;
            }
        }
        function SendtophpQ() {
            var expName = document.form1.tasktitle.value;

        }
        function QuesEn() {
            var continu = document.getElementById('questionsSec');
            continu.style.visibility = 'visible';
        }
// ajax send Info to php  

//retrieve info
 
            function retriveAll(){
            var response=new Array();
                var question=document.form1.questionName.value;
                var comment=document.form1.comment.value;
         //       var response[0]="question";
           //     reponse[1]="comment";
                return response;
            }
function sendQA(str)
{
//var str=new array();
  //          str=AddAnswers();
            //setUP ajax
var xmlhttp;
if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("fooBar").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","newExpe.php?q="+str,true);
xmlhttp.send();
}
   
    

    
        
    